package observer;

/**
 * @author Koizumi Sinya
 * @date 2018/03/19. 21:37
 * @edithor
 * @date
 */
public class Main {
    public static void main(String[] args) {
        NewsSubject subject = new NewsSubject();

        NewsObserver observer1 = new NewsObserver("新华社");
        NewsObserver observer2 = new NewsObserver("路透社");
        NewsObserver observer3 = new NewsObserver("美联社");
        NewsObserver observer4 = new NewsObserver("法新社");

        subject.attach(observer1);
        subject.attach(observer2);
        subject.attach(observer3);
        subject.attach(observer4);

        subject.notifyObserver("伟大的物理学家霍金去世");

    }
}
